# 设计一个抽奖程序，分别展示10次，100次，1000次抽奖的结果
import random
import decimal
#定义一个函数draw_prize,返回一个字符串，表示抽奖的结果
def draw_prize():
    return random.choice(['first prize', 'second prize', 'third prize','Thanks!'])

# 打印抽奖十次的结果
for i in range(10):
    print(f"prize drew{i+1}times: {draw_prize()}")

# 打印抽奖100次的结果
for i in range(100):
    print(f"prize drew{i+1}times: {draw_prize()}")
# 打印抽奖1000次的结果
for i in range(1000):
    print(f"prize drew{i+1}times: {draw_prize()}")

# 计算一等，二等，三等，谢谢惠顾的概率
first_count=0  # 一等奖的总个数=0
second_count=0  # 二等奖的总个数=0
third_count=0    # 三等奖的总个数=0
Thanks_count=0   # 谢谢惠顾的总个数=0

for i in range(1000):
    result = draw_prize()
    if result == 'first prize':
        first_count += 1
    elif result == 'second prize':
        second_count += 1
    elif result == 'third prize':
        third_count += 1
    else:
        Thanks_count+=1
first_probability = first_count / 1000
second_probability = second_count / 1000
third_probability = third_count / 1000
Thanks_probability = Thanks_count / 1000
print(f"一等奖概率：{first_probability:.6f}")
print(f"二等奖概率{second_probability:.6f}")
print(f"三等奖概率{third_probability:.6f}")
print(f"谢谢惠顾{Thanks_probability:.6f}")